import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        redirect: 'layout'
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login')
    },
    {
        path: '/layout',
        name: 'layout',
        redirect: 'home',
        component: () => import('@/views/Layout'),
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('@/views/layout/Home')
            },
            {
                path: '/question',
                name: 'question',
                component: () => import('@/views/layout/Question')
            },
            {
                path: '/video',
                name: 'video',
                component: () => import('@/views/layout/Video')
            },
            {
                path: '/info',
                name: 'info',
                component: () => import('@/views/layout/Info')
            }
        ]
    }
];

export default new VueRouter({
    routes
});
